package no.uio.inf5750.wsclient.dao.mockup;

import java.util.Vector;

import no.uio.inf5750.wsclient.dao.OrganisationUnitDAO;
import no.uio.inf5750.wsclient.model.OrganisationUnit;


/**
 * @author Philip Bruvoll
 * @version $Id: MockupOrganisationUnitDAO.java 28 2008-09-10 12:36:31Z philipjb
 *          $
 */
public class MockupOrganisationUnitDAO implements OrganisationUnitDAO {

    Vector orgUnits;

    public MockupOrganisationUnitDAO() {
        orgUnits = new Vector();
        OrganisationUnit orgUnit;
        for (int i = 0; i < 10; i++) {
            orgUnit = new OrganisationUnit();
            orgUnit.setId(i);
            orgUnit.setName("OrgUnit" + i);
            orgUnits.addElement(orgUnit);
        }
    }

    public OrganisationUnit getOrganisationUnit(int orgUnitId) {
        return (OrganisationUnit)orgUnits.elementAt(orgUnitId);
    }

    public Vector listOrganisationUnits(OrganisationUnit parent) {
        return orgUnits;
    }
}
